-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TDL-14896: Make batch_size apply to the first page and TDL-14895: Use the pagination__list_subscriber_interval_quantity config value correctly #64
base: master
Are you sure you want to change the base?
Conversation
@@ -38,10 +38,15 @@ class CampaignDataAccessObject(DataAccessObject): | |||
KEY_PROPERTIES = ['id'] | |||
|
|||
def sync_data(self): | |||
batch_size = int(self.config.get('batch_size', 2500)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are using this variable in multiple places, can we create a one base file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -19,6 +19,7 @@ def __init__(self, config, state, auth_stub, catalog): | |||
self.state = state.copy() | |||
self.catalog = catalog | |||
self.auth_stub = auth_stub | |||
self.batch_size = int(self.config.get('batch_size', 2500)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use self.batch_size here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, here the batch size is initialized.
tests/test_exacttarget_pagination.py
Outdated
|
||
# collect information for assertions from sync based on expected values | ||
record_count_sync = sync_record_count.get(stream, 0) | ||
primary_keys_list = [(message.get('data').get(expected_pk) for expected_pk in expected_primary_keys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this use: tuple([message['data']['expected_pk'] for expected_pk in expected_primary_keys])
as first comprehension here that iterates over the expected_primary_keys, is just making generators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return props | ||
|
||
def test_run(self): | ||
page_size = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have records then use at least 2 instead of one to test pagination properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Email has 2 records only. So, we cannot use page size 2.
@@ -7,13 +7,13 @@ | |||
LOGGER = singer.get_logger() | |||
|
|||
|
|||
def _get_response_items(response): | |||
def _get_response_items(response, name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments to the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments
@@ -107,6 +107,8 @@ def request(name, selector, auth_stub, search_filter=None, props=None, batch_siz | |||
""" | |||
cursor = selector() | |||
cursor.auth_stub = auth_stub | |||
# set batch size | |||
cursor.options = {"BatchSize": batch_size} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments regarding the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment
if isinstance(cursor, FuelSDK.ET_Campaign): | ||
# use 'getMoreResults' for campaigns as it does not use | ||
# batch_size, rather it uses $page and $pageSize and REST Call | ||
response = cursor.getMoreResults() | ||
else: | ||
# Override call to getMoreResults to add a batch_size parameter | ||
# response = cursor.getMoreResults() | ||
response = tap_exacttarget__getMoreResults(cursor, batch_size=batch_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the above changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of the above change is to support pagination in the tap to run the pagination test.
…nResetErrors (#71) * added backoff for certain errors * resolve pylint * updated decorator location * added unittests * added comment * added comments
* updated error message when generating auth_stub * made changes according to the comments * updated the code acording to the comments * updated the tap tester image * updated pylint and astroid to latest version * updated the code as, on updating tap tester image it was throwing cascading errors * updated config.yml file * updated the start date for integration tests as per the params * removed scenario as new tap-tester version does not support it * updated start date in the base file test
* added best practices * resolve pylint * resolve test failure * test: updated the test cases * test: updated some test cases * updated the code as per comments * resolve test case failure * updated the code as per comments * resolve integration test failure * resolve tes case failure * resolve test case failure * add data extension stream in test cases * added data extension incremental stream * test: run bookmark test * test: run bookmark test * test: run bookmark test, debug failing test * test: pylint resolve * test: run all data extenstion stream test in bookmark test * test: updated data extension code * updated the test to run data extension stream * run all tests * added sys.exit and updated pylint and astroid to latest versions * resolve pylint * updated the files as per comments * updated the code
…stream does not bookmark correctly (#75) * make keys automatic * pylint resolve * add full replication test case * added code change for data extension stream * pylint resolve * added comment * added comments * added comment in base file * updated discovery test and removed full replication test * updated the code * added a comment explaining subscriber and list subscriber syncing * added comments
* make keys automatic * pylint resolve * add full replication test case * use transformation * resolve pylint * added code change for data extension stream * pylint resolve * updated test case for data extension * added comment * added comments * added comments and optimized that condition * added code change for tranformation function in base file * pylint resolve * disabled pylint error * test: removed disable pylint code * added comment in base file * updated comment * updated the comment for skipping streams * updated discovery test and removed full replication test * added verification of unique records * updated start date * updated the code * updated the code * added a comment explaining subscriber and list subscriber syncing * added comments * updated comment * made separate files for schemas * resolve pylint * resolve integration test * corrected typo * updated the code * resolved unittest case error
* added code change to use start date when state is not passed * updated code based on comments * resolve test case failure * added data extension stream in tests * add data extension incremental stream * added future date test * updated start date test case * updated future start date test code * updated the code * added comment * added more comments in the code * resolve unittests failure * resolve integration test failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this PR be closed? It looks like the changes may have been covered elsewhere.
Description of change
TDL-14896: Make batch_size apply to the first page
TDL-14895: Use the pagination__list_subscriber_interval_quantity config value correctly
Manual QA steps
Risks
Rollback steps